package com.onlineMIS.ORM.entity.headQ.supplier.supplierMgmt;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Row;

import com.onlineMIS.ORM.entity.headQ.finance.ChainAcctFlowReportItem;
import com.onlineMIS.common.Common_util;
import com.onlineMIS.common.ExcelTemplate;
import com.onlineMIS.common.loggerLocal;

public class HeadQSupplierTemplate extends ExcelTemplate {
	
	private List<HeadQSupplierVO> list = new ArrayList<HeadQSupplierVO>();

	public HeadQSupplierTemplate(String templateWorkbookPath,List<HeadQSupplierVO> list) throws IOException {
		super(templateWorkbookPath);
		this.list =  list;
	}
	
	public HSSFWorkbook process() {
		
		HSSFSheet sheet = templateWorkbook.getSheetAt(0);
		
		for (int i = 0; i < list.size(); i++) {
			HeadQSupplierVO item = list.get(i);
			Row row = sheet.createRow(i + 1);
			row.createCell(0).setCellValue(item.getName());
			row.createCell(1).setCellValue(item.getTags());
			row.createCell(2).setCellValue(item.getInitialAcctBalance());
			row.createCell(3).setCellValue(item.getCurrentAcctBalance()); 
			if (item.getStatus() == 0) {
				row.createCell(4).setCellValue("正常"); 
			}else {
				row.createCell(4).setCellValue("冻结"); 
			}
			row.createCell(5).setCellValue(item.getComment()); 
			row.createCell(6).setCellValue(item.getAddress()); 

		}
		return templateWorkbook;
	}
	

}
